using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.TeamFoundation.Proxy;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.Server;
using Microsoft.TeamFoundation.WorkItemTracking.Client;
using Microsoft.TeamFoundation;
using Microsoft.TeamFoundation.VersionControl.Client;
using System.Windows.Forms;

namespace PackageMaker2008
{
    static class ServerConnection
    {
        public static TeamFoundationServer ConnectTfs(string server_str)
        {
            try
            {
                //  this.Enabled = false;
                ICredentialsProvider provider = new UICredentialsProvider();
                TeamFoundationServer server = TeamFoundationServerFactory.GetServer(server_str, provider);
                server.Authenticate();            

                return server;
            }
            catch (Exception ex)
            {
                return null;
            }
        }     
    }
}
